#pragma once

#include "stdafx.h"

#include <string>
#include <map>
#include <set>

#include "IndexesToSearch.h"


class IndexMap
{

private:

	std::map<std::string, std::set<int>> filenameToIndex;
	std::map<std::string, int> wordToIndex;

public:

	IndexMap();

	bool containsWord(std::string& word, std::string& filename);
	std::set<std::string>* containsWords(std::set<std::string>& words,std::string& filename);
	void addWord(std::string& word, std::string& filename, std::set<int>& indexes);
	bool containsIndex(std::string& filename) const;

	std::set<int>* getIndex(std::string& filename);
	void save(std::string& pathToDir);
	static IndexesToSearch* load(std::string& pathToDir);
	static void create(std::string& pathToDir);

};